﻿using System.Collections.Generic;
using UnityEngine;
namespace GameDevClicker.Data {
    /// <summary>
    /// All variable data is stored in this object.
    /// </summary>
    public class GameData {
        //Time tracking
        public System.DateTime PreviousTickTime;

        //Resources
        public Resource Money;
        public Resource Code;
        public Resource Art;

        //Employees
        public Programmer Programmer;
        public Artist Artist;

        //Misc
        public Game Game;

        private GameData() {
            Money = new Resource(ResourceType.Money);
            Code = new Resource(ResourceType.Code);
            Art = new Resource(ResourceType.Art);

            Game = new Game();
        }

        /// <summary>
        /// Creates a new, empty game
        /// </summary>
        private void New() {
            Programmer = new Programmer(0, 0);
            Artist = new Artist(0, 0);
        }
        
        /// <summary>
        /// The current instance of the GameData.
        /// </summary>
        public static GameData Instance { get; private set; }

        /// <summary>
        /// Initialise the game data.
        /// </summary>
        public static void Initialize() {
            Instance = new GameData();
            Instance.New();
        }
    }
}